home *** CD-ROM | disk | FTP | other *** search
/ IRIS Performer 2.2 Friends Demo / SGI IRIS Performer 2.2 Friends Demo.iso / friends / openworlds / tix / StackWin.tcl < prev    next >
Text File  |  1997-11-22  |  1KB  |  66 lines

  1. # tixStackWindow --
  2. #
  3. #    Bare-bone NoteBook type of window.
  4. #
  5. #
  6. tixWidgetClass tixStackWindow {
  7.     -classname tixStackWindow
  8.     -superclass tixVStack
  9.     -method {
  10.     }
  11.     -flag {
  12.     }
  13.     -configspec {
  14.     }
  15. }
  16.  
  17. proc tixStackWindow::ConstructWidget {w} {
  18.     upvar #0 $w data
  19.  
  20.     set data(w:tabs) [tixSelect $w.tabs]
  21.  
  22.     # We can't use the packer because it will conflict with the
  23.     # geometry management of the VStack widget.
  24.     #
  25.     tixManageGeometry $data(w:tabs) "tixVStack::GeomProc $w"
  26. }
  27.  
  28. proc tixStackWindow::add {w child args} {
  29.     upvar #0 $w data
  30.  
  31.     set ret [eval tixChainMethod $w add $child $args]
  32.  
  33.     $data(w:tabs) add $child -command "$w raise $child" \
  34.     -text $data($child,label)
  35.  
  36.     return $ret
  37. }
  38.  
  39. proc tixStackWindow::raise {w child} {
  40.     upvar #0 $w data
  41.  
  42.     $data(w:tabs) config -value $child
  43.  
  44.     tixChainMethod $w raise $child
  45. }
  46.  
  47. proc tixStackWindow::Resize {w} {
  48.     upvar #0 $w data
  49.  
  50.     # We have to take care of the size of the tabs so that 
  51.     #
  52.     set tW [winfo reqwidth  $data(w:tabs)]
  53.     set tH [winfo reqheight $data(w:tabs)]
  54.  
  55.     tixMoveResizeWindow $data(w:tabs) $data(-ipadx) $data(-ipady) $tW $tH
  56.     tixMapWindow $data(w:tabs)
  57.  
  58.     set data(pad-y1) [expr $tH + $data(-ipadx)]
  59.     set data(minW)   [expr $tW + 2 * $data(-ipadx)]
  60.     set data(minH)   [expr $tH + 2 * $data(-ipady)]
  61.  
  62.     # Now that we know data(pad-y1), we can chain the call
  63.     #
  64.     tixChainMethod $w Resize
  65. }
  66.